<?php

use think\facade\Route;


//公共内容
Route::group(function () {
    /**
     * @api {get} /avatar 用户图像库
     * @apiGroup 公共接口
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "list": [
     * "ewfwf.efwfsdf.png",
     * "ewfwf.efwfsdf.png",
     * "ewfwf.efwfsdf.png"
     * ]
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/avatar', 'index/avatar');
    /**
     * @api {get} /icon_list 记账类别图标库
     * @apiGroup 公共接口
     * @apiSuccess  {Array} icon_list 图标列表
     * @apiSuccess (icon_list) {string} title 图标分类名称
     * @apiSuccess (icon_list) {array} list 图标
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "icon_list": [
     * {
     * "title": "娱乐",
     * "list": [
     * "a.png",
     * "b.png",
     * "c.png"
     * ]
     * },
     * {
     * "title": "饮食",
     * "list": [
     * "d.png",
     * "e.png"
     * ]
     * }
     * ]
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/icon_list', 'index/iconList');


})->middleware(\app\api\middleware\Log::class);

//账目查询
Route::group(function () {

    /**
     * @api {post} /report_table 获取报表信息
     * @apiGroup 账目查询
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} year 查询年
     * @apiParam {String} type 1 支出 2 收入
     * @apiParam {String} month <code>可选</code>查询月
     * @apiParam {String} week <code>可选</code>查询周
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "type":"1",
     * "year":"2021",
     * "month":"7",
     * "week":"25"
     * }
     *
     * @apiSuccess  {object} data 年账单信息
     * @apiSuccess (data) {array} year_data 当年信息
     * @apiSuccess (data) {array} week_data 当周信息
     * @apiSuccess (data) {array} month_data 月信息
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "data": {
     * "month_data": {
     * "total_money": 1040,
     * "detail": [
     * {
     * "img": "",
     * "cate_name": "餐厅",
     * "ratio": "61.54%",
     * "cate_detail": [
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 100,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 540,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0
     * ]
     * },
     * {
     * "img": "",
     * "cate_name": "蔬菜",
     * "ratio": "38.46%",
     * "cate_detail": [
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 400,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0,
     * 0
     * ]
     * }
     * ]
     * },
     * "year_data": [],
     * "week_data": []
     * }
     * },
     * "result_code": "0000",
     * "result_info": "成功"
     * }
     */
    Route::rule('/report_table', 'bill/reportTable');

    /**
     * @api {post} /month_log 获取指定年记录
     * @apiGroup 账目查询
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} year 查询年
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "year":"2021"
     * }
     *
     * @apiSuccess  {object} data 年账单信息
     * @apiSuccess (data) {float} outlay 当年支出总额
     * @apiSuccess (data) {float} income 当年收入
     * @apiSuccess (data) {array} months_list 月账单信息
     * @apiSuccess (days_list) {string} date 月份
     * @apiSuccess (days_list) {float} outlay 当月支出
     * @apiSuccess (days_list) {float} income 当月收入
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "data": {
     * "outlay": 1040,
     * "income": 0,
     * "month_list": [
     * {
     * "date": "2021/2",
     * "outlay": 0,
     * "income": 0
     * },
     * {
     * "date": "2021/1",
     * "outlay": 0,
     * "income": 0
     * }
     * ]
     * }
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/year_log', 'bill/yearLog');

    /**
     * @api {post} /month_log 获取指定月份记录
     * @apiGroup 账目查询
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} month 查询月份
     * @apiParam {String} year 查询年
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "month":"1",
     * "year":"2021"
     * }
     *
     * @apiSuccess  {object} user_info 用户信息
     * @apiSuccess (user_info) {string} avatar 头像
     * @apiSuccess (user_info) {string} tel 手机号
     * @apiSuccess  {object} data 账单信息
     * @apiSuccess (data) {float} budget 预算金额
     * @apiSuccess (data) {float} outlay 当月支出总额
     * @apiSuccess (data) {float} income 当月收入
     * @apiSuccess (data) {array} days_list 每日账单信息
     * @apiSuccess (days_list) {string} date 日期
     * @apiSuccess (days_list) {float} outlay 当日支出
     * @apiSuccess (days_list) {float} income 当日收入
     * @apiSuccess (days_list) {array} bill_list 当日账单列表
     * @apiSuccess (bill_list) {int} id 账单id
     * @apiSuccess (bill_list) {int} cate_id 分类id
     * @apiSuccess (bill_list) {int} cate_type 账单类型 1 收入 2 支出
     * @apiSuccess (bill_list) {string} cate_name 分类名称
     * @apiSuccess (bill_list) {float} total 变动金额
     * @apiSuccess (bill_list) {int} add_time 账单时间（秒时间戳）
     * @apiSuccess (bill_list) {string} remarks 备注信息
     * @apiSuccess (bill_list) {string} img 图标
     *
     *
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "data": {
     * "budget": 0,
     * "outlay": 1040,
     * "income": 0,
     * "bill_list": [
     * {
     * "date": "2021/07/22",
     * "outlay": 540,
     * "income": 0,
     * "bill_list": [
     * {
     * "id": 2,
     * "cate_id": 1,
     * "cate_type": 2,
     * "cate_name": "餐厅",
     * "total": "108.00",
     * "add_time": 1626883200,
     * "remarks": "进给发fefefefe",
     * "img": "1"
     * }
     * ]
     * },
     * {
     * "date": "2021/07/7",
     * "outlay": 500,
     * "income": 0,
     * "bill_list": [
     * {
     * "id": 1,
     * "cate_id": 1,
     * "cate_type": 2,
     * "cate_name": "餐厅",
     * "total": "100.00",
     * "add_time": 1625587200,
     * "remarks": "进给发",
     * "img": "1"
     * }
     * ]
     * }
     * ]
     * },
     * "user_info": {
     * "avatar": "0",
     * "tel": "188****8888"
     * }
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/month_log', 'bill/monthLog');

    /**
     * @api {post} /add_budget 添加预算
     * @apiGroup 账目查询
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} year 年份
     * @apiParam {String} month 月份
     * @apiParam {String} money 预算金额
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "year":"2021",
     * "month":"7",
     * "money":"5000.00"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/add_budget', 'bill/addBudget');

    /**
     * @api {post} /batch_add_budget 批量添加预算
     * @apiGroup 账目查询
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} data 数据（json串）
     * @apiParamExample {json} request-example
     * {
     * "token": "ANhJ9GnaG82sGpEomqD/eGHF3LU6Bhb78QwEwNxHhQa7E/kyuWXl5yoNcPgz3T83TZjIhpja7+xPk1Jcn07dwrBGPIpNu8ai/7E4gNpi1iY=",
     * "data": [
     * {
     * "year": "2021",
     * "month": "7",
     * "money": "2000",
     * }
     * ]
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/batch_add_budget', 'bill/batchAddBudget');

})->middleware(\app\api\middleware\Log::class);

//记账
Route::group(function () {
    /**
     * @api {post} /user_cate 收入支出类目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4="
     * }
     *
     * @apiSuccess  {Array} cate_list 分类列表
     * @apiSuccess  {object} income_cate 收入分类
     * @apiSuccess  (income_cate) {array} use_cate 可使用分类
     * @apiSuccess (use_cate) {string} cate_name 分类名称
     * @apiSuccess (use_cate) {string} img 分类图片
     * @apiSuccess (use_cate) {number} cate_id 分类id
     * @apiSuccess (use_cate) {number} sort_num 排序值
     * @apiSuccess  (income_cate) {array} nouse_cate 未使用分类
     * @apiSuccess (nouse_cate) {string} cate_name 分类名称
     * @apiSuccess (nouse_cate) {string} img 分类图片
     * @apiSuccess (nouse_cate) {number} cate_id 分类id
     * @apiSuccess (nouse_cate) {number} sort_num 排序值
     * @apiSuccess  {object} outlay_cate 收入分类
     * @apiSuccess  (outlay_cate) {array} use_cate 可使用分类
     * @apiSuccess (use_cate) {string} cate_name 分类名称
     * @apiSuccess (use_cate) {string} img 分类图片
     * @apiSuccess (use_cate) {number} cate_id 分类id
     * @apiSuccess (use_cate) {number} sort_num 排序值
     * @apiSuccess  (income_cate){array} nouse_cate 未使用分类
     * @apiSuccess (nouse_cate) {string} cate_name 分类名称
     * @apiSuccess (nouse_cate) {string} img 分类图片
     * @apiSuccess (nouse_cate) {number} cate_id 分类id
     * @apiSuccess (nouse_cate) {number} sort_num 排序值
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "cate_list": {
     * "income_cate": {
     * "use_cate": [
     * {
     * "cate_name": "工资",
     * "img": "27",
     * "cate_id": 27,
     * "sort_num": 1
     * },
     * {
     * "cate_name": "兼职",
     * "img": "28",
     * "cate_id": 28,
     * "sort_num": 2
     * }
     * ],
     * "nouse_cate": []
     * },
     * "outlay_cate": {
     * "use_cate": [
     * {
     * "cate_name": "餐饮",
     * "img": "1",
     * "cate_id": 1,
     * "sort_num": 1
     * },
     * {
     * "cate_name": "购物",
     * "img": "2",
     * "cate_id": 2,
     * "sort_num": 2
     * }
     * ],
     * "nouse_cate": []
     * }
     * }
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/user_cate', 'bill/cate');

    /**
     * @api {post} /cate_sort 类目排序
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} cate_type 类目类别 1 支出 2 收入
     * @apiParam {String} sort_data 排序数据  {"cate_id":"类别id","sort_num":"排序值"}
     * @apiParamExample {json} request-example
     * {
     * "token": "ANhJ9GnaG82sGpEomqD/eGHF3LU6Bhb78QwEwNxHhQa7E/kyuWXl5yoNcPgz3T83TZjIhpja7+xPk1Jcn07dwrBGPIpNu8ai/7E4gNpi1iY=",
     * "sort_data": [{"cate_id":27,"sort_num":10},{"cate_id":28,"sort_num":55},{"cate_id":29,"sort_num":12},{"cate_id":30,"sort_num":20},{"cate_id":31,"sort_num":15}],
     * "cate_type": 2
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/cate_sort', 'bill/cateSort');

    /**
     * @api {post} /del_cate 删除类目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} cate_id 类目id
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "cate_id":"1"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/del_cate', 'bill/delCate');

    /**
     * @api {post} /add_cate 添加类目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} cate_id 类目id  系统分类传cate_id  自定义新增固定传0
     * @apiParam {String} cate_type 类目类型  1 支出 2 收入
     * @apiParam {String} cate_name 类目名称
     * @apiParam {String} cate_img 类目图标
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "cate_id":"0",
     * "cate_type":"2",
     * "cate_name":"日化",
     * "cate_img":"a.png"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/add_cate', 'bill/addCate');

    /**
     * @api {post} /edit_cate 修改类目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} cate_id 类目id
     * @apiParam {String} cate_name 类目名称
     * @apiParam {String} cate_img 类目图标
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "cate_id":"1",
     * "cate_name":"日化",
     * "cate_img":"a.png"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "操作成功",
     * "result_data": []
     * }
     */
    Route::rule('/edit_cate', 'bill/editCate');

    /**
     * @api {post} /add_bill 添加账目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} total 金额
     * @apiParam {String} cate_type 账目类型 1 支出 2 收入
     * @apiParam {String} cate_id 分类id
     * @apiParam {String} add_time 发生时间
     * @apiParam {String} remarks 备注
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "cate_type":"1",
     * "total":"100",
     * "cate_id":"1",
     * "add_time":"2021-07-07",
     * "remarks":"就是玩"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "添加成功",
     * "result_data": []
     * }
     */
    Route::rule('/add_bill', 'bill/addBill');
    /**
     * @api {post} /batch_add_bill 批量添加账目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} data 账目json串
     * @apiParamExample {json} request-example
     * {
     * "token": "ANhJ9GnaG82sGpEomqD/eGHF3LU6Bhb78QwEwNxHhQa7E/kyuWXl5yoNcPgz3T83TZjIhpja7+xPk1Jcn07dwrBGPIpNu8ai/7E4gNpi1iY=",
     * "data": [
     * {
     * "cate_type": "2",
     * "total": "100",
     * "cate_id": "2",
     * "add_time": "2021-07-07",
     * "remarks": "就是玩"
     * }
     * ]
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "添加成功",
     * "result_data": []
     * }
     */
    Route::rule('/batch_add_bill', 'bill/batchAddBill');

    /**
     * @api {post} /edit_bill 编辑账目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} bill_id 账目id
     * @apiParam {String} total 金额
     * @apiParam {String} add_time 发生时间
     * @apiParam {String} remarks 备注
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "bill_id":"1",
     * "total":"100",
     * "add_time":"2021-07-07",
     * "remarks":"就是玩"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "添加成功",
     * "result_data": []
     * }
     */
    Route::rule('/edit_bill', 'bill/editBill');
    /**
     * @api {post} /del_bill 删除账目
     * @apiGroup 记账
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} bill_id 账目id
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "bill_id":"1"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "删除成功",
     * "result_data": []
     * }
     */
    Route::rule('/del_bill', 'bill/delBill');

})->middleware(\app\api\middleware\Log::class);

//文件，图片上传
Route::rule("/upimage", "index/upimage");

//个人中心
Route::group(function () {
    /**
     * @api {post} /save_member 基础资料修改
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} avatar <code>可选</code>头像
     * @apiParam {String} gender 性别  1 男 2 女
     * @apiParam {String} birthday 生日
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "avatar":"0",
     * "gender":"1",
     * "birthday":"2021-07-21"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "修改成功",
     * "result_data": []
     * }
     */
    Route::rule('/save_member', 'user/modify');

    /**
     * @api {post} /password 用户修改密码
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} before_pass 原密码
     * @apiParam {String} new_password 新密码
     * @apiParam {String} again_password 确认新密码
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "before_pass":"123456",
     * "new_password":"111111",
     * "again_password":"111111"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "修改成功",
     * "result_data": []
     * }
     */
    Route::rule('/password', 'user/setLoginPassword');

    /**
     * @api {post} /check_user 验证账号
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} mobile 手机号
     * @apiParam {String} password 密码
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "mobile":"17777777777",
     * "password":"111111",
     * }
     *
     * @apiSuccess {String} check_code 验证成功code值，更换手机号使用
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "check_code": "cf0c2d3db1985793083837f2d43af40c"
     * },
     * "result_code": "0000",
     * "result_info": "验证成功"
     * }
     */
    Route::rule('/check_user', 'user/checkUser');

    /**
     * @api {post} /change_mobile 更换手机号
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParam {String} mobile 手机号
     * @apiParam {String} check_code 验证code
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * "mobile":"17777777777",
     * "check_code":"cf0c2d3db1985793083837f2d43af40c",
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "更换成功",
     * "result_data": []
     * }
     */
    Route::rule('/change_mobile', 'user/changeMobile');

    /**
     * @api {post} /logout 退出登录
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "退出成功",
     * "result_data": []
     * }
     */
    Route::rule('/logout', 'user/logout');


    /**
     * @api {post} /destroy_user 注销账户
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "result_code": "0000",
     * "result_info": "注销成功",
     * "result_data": []
     * }
     */
    Route::rule('/destroy_user', 'user/destroyUser');

    /**
     * @api {post} /user_info 用户个人信息
     * @apiGroup 个人中心
     *
     * @apiParam {String} token 用户凭证
     * @apiParamExample {json} request-example
     * {
     * "token": "iTYGI0eKnmYb8BmSIiRALogJGXqtkoc6qKXqSxL3F51kjTMtjdbGPaPg+ZxujBLbXF5F0ZaZjEl6ZXyzNyXNtHcfsRF/UpSsPYO6ug/u2H4=",
     * }
     *
     * @apiSuccess  {object} data 会员信息
     * @apiSuccess (data) {string} user_id 会员id
     * @apiSuccess (data) {string} avatar 头像
     * @apiSuccess (data) {string} gender 性别
     * @apiSuccess (data) {string} birthday 生日
     * @apiSuccess (data) {string} facebook_status facebook绑定状态
     * @apiSuccess (data) {string} google_status google绑定状态
     * @apiSuccess (data) {string} password_status 密码设置状态
     * @apiSuccess (data) {string} tel 手机号
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "data": {
     * "user_id": 1,
     * "avatar": "0",
     * "gender": "男",
     * "birthday": "",
     * "facebook_status": 0,
     * "google_status": 0,
     * "password_status": 1,
     * "tel": "188****8888"
     * }
     * },
     * "result_code": "0000",
     * "result_info": "请求成功"
     * }
     */
    Route::rule('/user_info', 'user/userInfo');
})->middleware(\app\api\middleware\Log::class);


//登录注册
Route::group(function () {

    /**
     * @api {post} /get_code 获取验证码
     * @apiGroup 登录注册
     *
     * @apiParam {String} mobile 手机号
     * @apiParam {String} type 验证码类型 2 修改密码 3 登录注册
     * @apiParamExample {json} request-example
     * {
     * "mobile":"15554832010",
     * "type":"3"
     * }
     *
     * @apiSuccess {String} msg 验证码发送提示消息
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "msg": "验证码发送成功，有效期10分钟"
     * },
     * "result_code": "0000",
     * "result_info": "发送成功"
     * }
     */
    Route::rule("/get_code", "login/getCode");
//用户注册
//    Route::rule("/register", "login/register");

    /**
     * @api {post} /login_pwd 用户密码登录
     * @apiGroup 登录注册
     *
     * @apiParam {String} mobile 手机号
     * @apiParam {String} password 密码
     * @apiParamExample {json} request-example
     * {
     * "mobile":"18888888888",
     * "password":"123456"
     * }
     *
     * @apiSuccess {String} token 用户token
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "token": "iTYGI0eKnmYb8BmSIiRALpjrA5RLRxBmhsVEKraI4Ht0q8HUqOOiufZ02E8g6rX50JBje48KITafhBq/6bGTRzotlR3XDEsE86auzMuQ+fI="
     * },
     * "result_code": "0000",
     * "result_info": "登录成功"
     * }
     */
    Route::rule("/login_pwd", "login/loginPwd");

    /**
     * @api {post} /login_code 用户验证码登录
     * @apiGroup 登录注册
     *
     * @apiParam {String} mobile 手机号
     * @apiParam {String} code 验证码
     * @apiParamExample {json} request-example
     * {
     * "mobile":"15554832010",
     * "code":"577997"
     * }
     *
     * @apiSuccess {String} token 用户token
     * @apiSuccessExample  {json} success-example
     * {
     * "result_data": {
     * "token": "iTYGI0eKnmYb8BmSIiRALpjrA5RLRxBmhsVEKraI4Ht0q8HUqOOiufZ02E8g6rX50JBje48KITafhBq/6bGTRzotlR3XDEsE86auzMuQ+fI="
     * },
     * "result_code": "0000",
     * "result_info": "登录成功"
     * }
     */
    Route::rule("/login_code", "login/loginCode");

    /**
     * @api {post} /modify_password 用户忘记密码
     * @apiGroup 登录注册
     *
     * @apiParam {String} mobile 手机号
     * @apiParam {String} code 验证码
     * @apiParam {String} new_password 新密码
     * @apiParamExample {json} request-example
     * {
     * "mobile":"15554832010",
     * "code":"577997"
     * }
     *
     * @apiSuccessExample  {json} success-example
     * {
     * "mobile":"18888888888",
     * "code":"1235",
     * "new_password":"123456"
     * }
     */
    Route::rule("/modify_password", "login/modifyPassword");

})->middleware(\app\api\middleware\Log::class);